package com.zmn.oms.dubbo.interfaces.normal.order;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.common.dto2.data.LayuiTableDO;
import com.zmn.oms.common.dio.normal.query.OrderRefundDetailDIO;
import com.zmn.oms.common.dio.normal.query.OrderUserWaitDIO;
import com.zmn.oms.common.dio.normal.query.OrderWorkQueryDIO;
import com.zmn.oms.common.dro.normal.order.OrderRelationDRO;
import com.zmn.oms.common.dro.normal.order.OrderWorkDRO;
import com.zmn.oms.common.dro.normal.order.OrderWorkListDRO;
import com.zmn.oms.dubbo.dto.zmn.order.OrderRefundDetailDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 类描述：普通单远程接口
 *
 * @author wangxiaokun
 * @since 2021/04/01 10:33
 */
@Api(
        value = "工单查询",
        tags = {"工单查询"}
)
public interface NormalOrderWorkListRemoteService {

    @ApiOperation(
            value = "根据工单号查询关联工单",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<OrderRelationDRO> getOrderRelationByOrderIdAndWorkId(@NotNull(message = "订单号不能为空")
                                                                     @ApiParam(value = "订单号", required = true)
                                                                             Long orderId,
                                                                     @NotNull(message = "工单号不能为空")
                                                                     @ApiParam(value = "工单好", required = true)
                                                                             Long workId);

    /**
     * 根据用户ID查询工单
     * @see NormalOrderWorkListRemoteService#countOrderWorkByQuery(com.zmn.oms.common.dio.normal.query.OrderWorkQueryDIO)
     * @param userId
     * @return
     */
    @ApiOperation(
            value = "根据用户ID查询工单",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    @Deprecated
    ResponseDTO<Integer> countOrderWorkByUserId(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true) Long userId);

    @ApiOperation(
            value = "查询订单数量",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<Integer> countOrderWorkByQuery(@NotNull(message = "入参不能为空") OrderWorkQueryDIO orderWorkQueryDIO);

    @ApiOperation(
            value = "查询用户等待订单数量",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<Integer> countUserWaitOrderWorkByQuery(@NotNull(message = "入参不能为空") OrderUserWaitDIO OrderUserWaitDIO);

    @ApiOperation(
            value = "根据手机号查询工单列表",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<List<OrderWorkListDRO>> listOrderWorkByQuery(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true) OrderWorkQueryDIO orderWorkQueryDIO);

    @ApiOperation(
            value = "根据ID查询工单",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<OrderWorkDRO> getOrderWorkByWorkId(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true) Long workId);

    @ApiOperation(
            value = "根据手机号查询临时用户工单列表",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<LayuiTableDO> listTempUserOrderWorkByQuery(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true) OrderWorkQueryDIO orderWorkQueryDIO);

    @ApiOperation(
            value = "根据订单号查询退款明细列表",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<LayuiTableDO<OrderRefundDetailDRO>> listOrderRefundDetailByQuery(@NotNull(message = "入参不能为空") @ApiParam(value = "入参", required = true) OrderRefundDetailDIO orderRefundDetailDIO);


    @ApiOperation(
            value = "根据工单号查询取消重复单号",
            response = ResponseDTO.class,
            tags = {"工单查询"}
    )
    ResponseDTO<Long> getDuplicateOrderIdByOrderIdAndWorkId(@NotNull(message = "订单号不能为空")
                                                            @ApiParam(value = "订单号", required = true)
                                                                    Long orderId,
                                                            @NotNull(message = "工单号不能为空")
                                                            @ApiParam(value = "工单好", required = true)
                                                                    Long workId);
}
